.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "HUNSPELL" "1" "January 2018" "" ""
.
.SH "NAME"
\fBhunspell\fR \- spell checker, stemmer and morphological analyzer
.
.SH "SYNOPSIS"
.
.nf

hunspell [\-1aDGHhLlmnOrstvwX]  [\-\-check\-url] [\-\-check\-apostrophe]
         [\-d dict[,dict2,\.\.\.]] [\-\-help] [\-i enc] [\-p dict] [\-vv] [\-\-version]
         [<text/OpenDocument/TeX/LaTeX/HTML/SGML/XML/nroff/troff file(s)>]
.
.fi
.
.SH "DESCRIPTION"
Hunspell is fashioned after the Ispell program\. The most common usage is \fBhunspell\fR or \fBhunspell <filename>\fR\. Without filename parameter, hunspell checks the standard input\. Typing \fBcat\fR and \fBexsample\fR in two input lines, results an asterisk (it means \fBcat\fR is a correct word) and a line with corrections:
.
.IP "" 4
.
.nf

$ hunspell \-d en_US
Hunspell 1\.2\.3
*
& exsample 4 0: example, examples, ex sample, ex\-sample
.
.fi
.
.IP "" 0
.
.P
Correct words signed with an \fB*\fR, \fB+\fR or \fB\-\fR, unrecognized words signed with \fB#\fR or \fB&\fR in output lines (see later)\. (Close the standard input with Ctrl\-d on Unix/Linux and Ctrl\-Z Enter or Ctrl\-C on Windows\.)
.
.P
With filename parameters, hunspell will display each word of the files which does not appear in the dictionary at the top of the screen and allow you to change it\. If there are "near misses" in the dictionary, then they are also displayed on following lines\. Finally, the line containing the word and the previous line are printed at the bottom of the screen\. If your terminal can display in reverse video, the word itself is highlighted\. You have the option of replacing the word completely, or choosing one of the suggested words\. Commands are single characters as follows (case is ignored):
.
.TP
R
Replace the misspelled word completely\.
.
.TP
Space
Accept the word this time only\.
.
.TP
A
Accept the word for the rest of this hunspell session\.
.
.TP
I
Accept the word, capitalized as it is in the file, and update private dictionary\.
.
.TP
U
Accept the word, and add an uncapitalized (actually, all lower\-case) version to the private dictionary\.
.
.TP
S
Ask a stem and a model word and store them in the private dictionary\. The stem will be accepted also with the affixes of the model word\.
.
.TP
0\-n
Replace with one of the suggested words\.
.
.TP
X
Write the rest of this file, ignoring misspellings, and start next file\.
.
.TP
Q
Exit immediately and leave the file unchanged\.
.
.TP
^Z
Suspend hunspell\.
.
.TP
?
Give help screen\.
.
.SH "OPTIONS"
.
.TP
\fB\-1\fR
Check only first field in lines (delimiter = tabulator)\.
.
.TP
\fB\-a\fR
The \-a option is intended to be used from other programs through a pipe\.
.
.TP
\fB\-\-check\-apostrophe\fR
Check and force Unicode apostrophes (U+2019), if one of the ASCII or Unicode apostrophes is specified by the spelling dictionary, as a word character (see WORDCHARS, ICONV and OCONV in hunspell(5))\.
.
.TP
\fB\-\-check\-url\fR
Check URLs, e\-mail addresses and directory paths\.
.
.TP
\fB\-D\fR
Show detected path of the loaded dictionary, and list of the search path and the available dictionaries\.
.
.TP
\fB\-d <dict>,<dict2>,\.\.\.\fR
Set dictionaries by their base names with or without paths\. Example of the syntax:
.
.IP
\fB\-d en_US,en_geo,en_med,de_DE,de_med\fR
.
.IP
\fBen_US\fR and \fBde_DE\fR are base dictionaries, they consist of aff and dic file pairs: \fBen_US\.aff, en_US\.dic\fR and \fBde_DE\.aff, de_DE\.dic\fR\. \fBEn_geo, en_med, de_med\fR are special dictionaries: dictionaries without affix file\. Special dictionaries are optional extension of the base dictionaries usually with special (medical, law etc\.) terms\. There is no naming convention for special dictionaries, only the "\.dic" extension: dictionaries without affix file will be an extension of the preceding base dictionary (right order of the parameter list needs for good suggestions)\. First item of \-d parameter list must be a base dictionary\.
.
.TP
\fB\-G\fR
Print only correct words or lines\.
.
.TP
\fB\-H\fR
The input file is in SGML/HTML format\.
.
.TP
\fB\-h, \-\-help\fR
Short help\.
.
.TP
\fB\-i\fR
enc Set input encoding\.
.
.TP
\fB\-L\fR
Print lines with misspelled words\.
.
.TP
\fB\-l\fR
The "list" option is used to produce a list of misspelled words from the standard input\.
.
.TP
\fB\-m\fR
Analyze the words of the input text (see also hunspell(5) about morphological analysis)\. Without dictionary morphological data, signs the flags of the affixes of the word forms for dictionary developers\.
.
.TP
\fB\-n\fR
The input file is in nroff/troff format\.
.
.TP
\fB\-O\fR
The input file is in OpenDocument (ODF or Flat ODF) format\. If unzip program is not installed, install it before using this option\.
.
.TP
\fB\-P <password>\fR
Set password for encrypted dictionaries\.
.
.TP
\fB\-p <dict>\fR
Set path of personal dictionary\. The default dictionary depends on the locale settings\. The following environment variables are searched: \fBLC_ALL\fR, \fBLC_MESSAGES\fR, and \fBLANG\fR\. If none are set then the default personal dictionary is \fB$HOME/\.hunspell_default\fR\.
.
.IP
Setting \-d or the DICTIONARY environmental variable, personal dictionary will be \fB$HOME/\.hunspell_dicname\fR
.
.TP
\fB\-r\fR
Warn of the rare words, which are also potential spelling mistakes\.
.
.TP
\fB\-s\fR
Stem the words of the input text (see also hunspell(5) about stemming)\. It depends from the dictionary data\.
.
.TP
\fB\-t\fR
The input file is in TeX or LaTeX format\.
.
.TP
\fB\-v, \-\-version\fR
Print version number\.
.
.TP
\fB\-vv\fR
Print ispell(1) compatible version number\.
.
.TP
\fB\-w\fR
Print misspelled words (= lines) from one word/line input\.
.
.TP
\fB\-X\fR
The input file is in XML format\.
.
.SH "Pipe Mode"
In this mode (\fB\-a\fR), hunspell prints a one\-line version identification message, and then begins reading lines of input\. For each input line, a single line is written to the standard output for each word checked for spelling on the line\. If the word was found in the main dictionary, or your personal dictionary, then the line contains only a \fB*\fR\. If the word was found through affix removal, then the line contains a \fB+\fR, a space, and the root word\. If the word was found through compound formation (concatenation of two words, then the line contains only a \fB\-\fR\.
.
.P
If the word is not in the dictionary, but there are near misses, then the line contains an \fB&\fR, a space, the misspelled word, a space, the number of near misses, the number of characters between the beginning of the line and the beginning of the misspelled word, a colon, another space, and a list of the near misses separated by commas and spaces\.
.
.P
Also, each near miss or guess is capitalized the same as the input word unless such capitalization is illegal; in the latter case each near miss is capitalized correctly according to the dictionary\.
.
.P
Finally, if the word does not appear in the dictionary, and there are no near misses, then the line contains a \fB#\fR, a space, the misspelled word, a space, and the character offset from the beginning of the line\. Each sentence of text input is terminated with an additional blank line, indicating that hunspell has completed processing the input line\.
.
.P
These output lines can be summarized as follows:
.
.TP
OK
\fB*\fR
.
.TP
Root
\fB+ <root>\fR
.
.TP
Compound
\fB\-\fR
.
.TP
Miss
\fB& <original> <count> <offset>: <miss>, <miss>, \.\.\.\fR
.
.TP
None
\fB# <original> <offset>\fR
.
.P
For example, a dummy dictionary containing the words "fray", "Frey", "fry", and "refried" might produce the following response to the command "echo \'frqy refries | hunspell \-a":
.
.IP "" 4
.
.nf

(#) Hunspell 0\.4\.1 (beta), 2005\-05\-26
& frqy 3 0: fray, Frey, fry
& refries 1 5: refried
.
.fi
.
.IP "" 0
.
.P
This mode is also suitable for interactive use when you want to figure out the spelling of a single word (but this is the default behavior of hunspell without \-a, too)\.
.
.P
When in the \-a mode, hunspell will also accept lines of single words prefixed with any of \fB*\fR, \fB&\fR, \fB@\fR, \fB+\fR, \fB\-\fR, \fB~\fR, \fB#\fR, \fB!\fR, \fB%\fR, \fB`\fR, or \fB^\fR\. A line starting with \fB*\fR tells hunspell to insert the word into the user\'s dictionary (similar to the I command)\. A line starting with \fB&\fR tells hunspell to insert an all\-lowercase version of the word into the user\'s dictionary (similar to the U command)\. A line starting with \fB@\fR causes hunspell to accept this word in the future (similar to the A command)\. A line starting with \fB+\fR, followed immediately by tex or nroff will cause hunspell to parse future input according the syntax of that formatter\. A line consisting solely of a \fB+\fR will place hunspell in TeX/LaTeX mode (similar to the \-t option) and \fB\-\fR returns hunspell to nroff/troff mode (but these commands are obsolete)\. However, the string character type is not changed; the \fB~\fR command must be used to do this\. A line starting with \fB~\fR causes hunspell to set internal parameters (in particular, the default string character type) based on the filename given in the rest of the line\. (A file suffix is sufficient, but the period must be included\. Instead of a file name or suffix, a unique name, as listed in the language affix file, may be specified\.) However, the formatter parsing is not changed; the \fB+\fR command must be used to change the formatter\. A line prefixed with \fB#\fR will cause the personal dictionary to be saved\. A line prefixed with \fB!\fR will turn on terse mode (see below), and a line prefixed with \fB%\fR will return hunspell to normal (non\-terse) mode\. A line prefixed with \fB`\fR will turn on verbose\-correction mode (see below); this mode can only be disabled by turning on terse mode with \fB%\fR\.
.
.P
Any input following the prefix characters \fB+\fR, \fB\-\fR, \fB#\fR, \fB!\fR, \fB%\fR, or \fB`\fR is ignored, as is any input following the filename on a \fB~\fR line\. To allow spell\-checking of lines beginning with these characters, a line starting with \fB^\fR has that character removed before it is passed to the spell\-checking code\. It is recommended that programmatic interfaces prefix every data line with an uparrow to protect themselves against future changes in hunspell\.
.
.P
To summarize these:
.
.TP
\fB*\fR
Add to personal dictionary
.
.TP
\fB@\fR
Accept word, but leave out of dictionary
.
.TP
\fB#\fR
Save current personal dictionary
.
.TP
\fB~\fR
Set parameters based on filename
.
.TP
\fB+\fR
Enter TeX mode
.
.TP
\fB\-\fR
Exit TeX mode
.
.TP
\fB!\fR
Enter terse mode
.
.TP
\fB%\fR
Exit terse mode
.
.TP
\fB`\fR
Enter verbose\-correction mode
.
.TP
\fB^\fR
Spell\-check rest of line
.
.P
In terse mode, hunspell will not print lines beginning with \fB*\fR, \fB+\fR, or \fB\-\fR, all of which indicate correct words\. This significantly improves running speed when the driving program is going to ignore correct words anyway\.
.
.P
In verbose\-correction mode, hunspell includes the original word immediately after the indicator character in output lines beginning with \fB*\fR, \fB+\fR, and \fB\-\fR, which simplifies interaction for some programs\.
.
.SH "EXAMPLES"
.
.TP
\fBhunspell example\.html\fR
Interactive spell checking of an HTML file with the default dictionary\.
.
.TP
\fBhunspell \-d en_US example\.html\fR
Interactive spell checking of an HTML file with the en_US dictionary\.
.
.TP
\fBhunspell \-d en_US,en_US_med medical\.txt\fR
Interactive spell checking with multiple dictionaries\.
.
.TP
\fBhunspell *\.odt\fR
Interactive spell checking of ODF documents\.
.
.TP
\fBhunspell \-l *\.odt\fR
List bad words of ODF documents
.
.TP
\fBhunspell \-l *\.odt | sort | uniq >unrecognized\fR
Saving unrecognized words of ODF documents (filtering duplications)\.
.
.TP
\fBhunspell \-p unrecognized_but_good *\.odt\fR
Interactive spell checking of ODF documents, using the previously saved and reduced word list, as a personal dictionary, to speed up spell checking\.
.
.SH "ENVIRONMENT"
.
.TP
DICTIONARY
Similar to \-d\.
.
.TP
DICPATH
Dictionary path\.
.
.TP
WORDLIST
Equivalent to \-p\.
.
.SH "FILES"
The default dictionary depends on the locale settings\. The following environment variables are searched: LC_ALL, LC_MESSAGES, and LANG\. If none are set then the following fallbacks are used:
.
.P
\fB/usr/share/myspell/default\.aff\fR Path of default affix file\. See hunspell(5)\.
.
.P
\fB/usr/share/myspell/default\.dic\fR Path of default dictionary file\. See hunspell(5)\.
.
.P
\fB$HOME/\.hunspell_default\fR\. Default path to personal dictionary\.
.
.SH "SEE ALSO"
hunspell(3), hunspell(5)
.
.SH "AUTHOR"
Author of Hunspell executable is László Németh\. For Hunspell library, see hunspell(3)\.
.
.P
This manual based on Ispell\'s manual\. See ispell(1)\.
